﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.AnalysisServices.AdomdClient;
using Microsoft.Practices.Unity;

namespace Moop.DataLayer.Olap
{
    public class OlapClient : IOlapClient
    {
        public string ConnectionString { get; set; }

        public OlapClient()
        {           
        }


        public AdomdConnection GetConnection()
        {
            AdomdConnection conn = null;
            try
            {
                conn = new AdomdConnection(ConnectionString);
                conn.Open();               
            }
            catch (Exception e)
            {
                conn.Close();
                conn.Dispose();
                throw (e);
            }

            return conn;
        }

    }
}
